<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../Vue.js/vue.js"></script>
</head>
<body>
    <div class="root">
        <!-- 下面persons项包括两个元素，一个是元素本身，一个是遍历时的索引值 -->
        <ul>
            <li v-for = "p in persons" :key = "p.id">
                {{p.name}}-{{p.age}}
            </li>
        </ul>
        <br>
        <ul>
            <li v-for = "(value, key) in car" :key = "key">
                {{value}}-{{key}}
            </li>
        </ul>
        <ul>
            <li v-for = "(a, b) in 5" :key = "b">
                {{b}}-{{a}}
            </li>
        </ul>
    </div>
</body>
<script>
    new Vue({
        el: ".root",
        data: {
            persons: [
                {name: "zhangsan", age: "15", id: 1},
                {name: "lisi", age: "16", id: 2},
                {name: "wangwu", age: "17", id: 3}
            ],
            car: {
                name: "宝马530i",
                price: "50w",
                color: "black"
            }
        }
    })
</script>
</html>